<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <meta name="description" content="">
    <script src="/static/mental_test_zhunle/js/rem.js"></script>
    <link rel="stylesheet" href="/static/mental_test_zhunle/css/style.css?v=1">
    <title>心理测试</title>
</head>
<body>
<div class="body_con">
    <!--导航栏-->
    <div class="nav_con">
        <div class="nav-box">
            <div class="nav-bg-color" style="height: {$height/50 + 0.88}rem"></div>
            <div class="back_con" onclick="commonJsToNative('local', 'back');">
                <img class="img_nav_back" src="/static/mental_test_zhunle/images/nav/back.png" alt="">
            </div>
            <div class="title-name">心理测试</div>
        </div>
    </div>
    {if $error_msg == ""}
    <!--中间部分-->
    <div class="middle_con" style="padding-top: {$height/50 + 0.88}rem">

        {if $data.status == 0}
        <!--答题页面-->
        <div class="answer_con">
            <!--题目-->
            <div class="title">{$data.title}</div>
            <!--选项列表部分-->
            <div class="options_con">
                {foreach $data['options'] as $k=>$v}
                <div id="option_con_{$k}" class="option_con" onclick="onClickOption('{$k}')">
                    <div id="option_text_{$k}" class="option_text">
                        {$v.option}.{$v.name}
                    </div>
                    <img id="option_img_{$k}" class="option_img" src="/static/mental_test_zhunle/images/radio_normal.png" alt="">
                </div>
                {/foreach}
            </div>
            <div class="btn" onclick="onClickBtnSubmit()">提交</div>
        </div>
        {else}
        <!--结果页面-->
        <div class="result_con">
            <!--题目-->
            <div class="title">{$data.title}</div>
            <!--所选择的选项-->
            <div class="option_con option_con_add_selected">
                <div class="option_text option_text_add_selected">
                    {$data.answer.option}.{$data.answer.name}
                </div>
                <img class="option_img " src="/static/mental_test_zhunle/images/radio_selected.png" alt="">
            </div>
            <!--结果部分-->
            <div class="content_con">
                <!--顶部标题-->
                <div class="top_con">
                    <img class="img_header" src="/static/mental_test_zhunle/images/result_header.png" alt="">
                    <div class="title">测试结果</div>
                    <img class="img_header" src="/static/mental_test_zhunle/images/result_header.png" alt="">
                </div>
                <!--结果内容-->
                <div class="text">
                    {$data.answer.content}
                </div>
            </div>
        </div>
        {/if}

        <!--底部绝对定位的心形图标-->
        <img class="img_bg" src="/static/mental_test_zhunle/images/bg.png" alt="">

        {else}
        <div class="error_con">
            <img class="img_err" src="/static/mental_test_zhunle/images/error.png" alt="">
            <div class="text_err">{$error_msg}</div>
        </div>
        {/if}


    </div>
</div>
{include file="../apps/web/view/public/sensors.html" /}
<script type="text/javascript">
    window.is_show_log = '{$is_show_log}';//是否展示日志
    window.navHeight = {$height};
    window.appType = '{$appType}';
    window.data = JSON.parse('{:json_encode($data)}');//数据

</script>
<script type="text/javascript" src="/static/mental_test_zhunle/js/jquery-v2.1.1.min.js?v=10"></script>
<script type="text/javascript" src="/static/mental_test_zhunle/js/common.js?v=10"></script>
</body>
</html>
